# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dnswalk
pkgver=2.0.2
pkgrel=12
groups=('blackarch' 'blackarch-recon' 'blackarch-scanner')
pkgdesc='A DNS debugger and zone-transfer utility.'
url='http://sourceforge.net/projects/dnswalk/'
license=('GPL')
arch=('any')
depends=('perl-net-dns')
source=("http://downloads.sourceforge.net/sourceforge/dnswalk/dnswalk-$pkgver.tar.gz"
        'dnswalk.patch')
sha512sums=('23e5408149ae65f69dbb6d0ecaf5b10233e2279a502f6e19f0dacde0e270ed4eed0aea72f8c12dd636228e99b0b115a335bb8327a0628ad1f36dae5f5572712c'
            '6438862040b95c9007dd66742871aa8f26bced0d867ab60bb26c0fc9f4226917f3a0915090762a6385b34ab2072dbd8936fd243d4f17252047c0ef61b6e0490f')

prepare() {
  patch -p1 < "$pkgname.patch"
  sed -i 's|/contrib/bin/perl|/bin/perl|' "$pkgname"
}

package() {
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -m 644 "do-$pkgname" CHANGES README TODO rfc1912.txt makereports \
    sendreports "$pkgdir/usr/share/doc/$pkgname/"
  install -Dm 644 "$pkgname.1" "$pkgdir/usr/share/man/man1/dnswalk.1"
  install -m 644 "$pkgname.errors" "$pkgdir/usr/share/doc/$pkgname/"
}

